package com.jt.demo;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.sound.midi.Soundbank;

@Component
public class Person {

    public Person(){
        System.out.println("张三出生，资质拉满");
    }

    @PostConstruct  //在对象创建之后立即调用
    public void init(){
        System.out.println("张三成为少年奇才");
    }

    //业务方法
    public void doWork(){

        System.out.println("迎娶美人鱼");
    }
    @PreDestroy
    public void destory(){
        System.out.println("销毁：全世界哀悼");
    }
}
